/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package yuhuibear.poat.exception;

/**
 * 
 * @author yuhuibear
 */
@SuppressWarnings("serial")
public class AnnotationConstrainException extends PoatException {

	public AnnotationConstrainException(Class<?> sourceClass, String name,
			Class<?> type, String constrain) {
		super(String.format("%s.%s violates constrain: %s , %s.", sourceClass, name, type.getName(), constrain));
		pushStackTraceElement(new StackTraceElement(sourceClass.getName(), name, type.getSimpleName()
				+ ":" + name, 0));
	}

	public AnnotationConstrainException(Class<?> sourceClass, Class<?> type,
			String constrain) {
		super(String.format("%s violates constrain: %s , %s.", sourceClass, type.getName(), constrain));
		pushStackTraceElement(new StackTraceElement(sourceClass.getName(), "", type.getSimpleName(), 0));
	}
}
